<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Testtemplate,com.ejoysoft.wlanyz.system.Maintainer,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@page import="sun.reflect.generics.tree.IntSignature"%>
<%@page import="com.ejoysoft.common.Format"%>
<%@ include file="../include/jsp/head.jsp"%>

<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Testpjmanage,com.ejoysoft.common.Constants,com.ejoysoft.wlanyz.system.SysUserUnit,com.ejoysoft.common.exception.NoRightException" %>

<%
 String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Maintainer obj=new Maintainer(globa);
String strMainName= ParamUtil.getString(request,"strMainName","");
String strMainMobile=ParamUtil.getString(request,"strMainMobile","");

String tWhere=" WHERE 1=1";
	if(!strMainName.equals("")){
     tWhere += " and strMainName LIKE '%"+ strMainName +"%'";
    }
	if (!strMainMobile.equals("")) {
		tWhere += " and strMainMobile LIKE '%" + strMainMobile + "%'";
	}
	 tWhere += " "; 
	int intAllCount=obj.getCount(tWhere);
	//当前页
	int intCurPage=globa.getIntCurPage();
	//每页记录数
	String strPageSize = ParamUtil.getString(request,"strPageSize","10");
    int intPageSize;
    if(strPageSize.equals("所有"))intPageSize = intAllCount;
      else  intPageSize = Integer.parseInt(strPageSize);
	//共有页数
 	int intPageCount=(intAllCount-1)/intPageSize+1;
	// 循环显示一页内的记录 开始序号
	int intStartNum=(intCurPage-1)*intPageSize+1;
	//结束序号
	int intEndNum=intCurPage*intPageSize;   
	//获取到当前页面的记录集
	Vector<Maintainer> vctObj=obj.list(tWhere,intStartNum,intPageSize);
	//获取当前页的记录条数
	int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
	 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试人选择</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
body,td,th {
	font-size: 9pt;
	color: #111111;
}
-->
</style>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script src="../include/js/chkFrm.js"></script>
<script language="javascript">
function showAc(){
  document.getElementById('<%=Constants.PAGE_SIZE_INDEX%>').value= "1";
  frm.submit();
 }


	      
   function check(){
           var checkboxs = window.document.getElementsByName("strManId");
           var flag=0; 
           for(var i=0;i<checkboxs.length;i++){
           if(checkboxs[i].checked == true){
                flag=flag+1;
           }
           }
           if(flag>1) 
           {
           alert("只能选择一个测试人员");
           }
           else
           {     
           for(var i=0;i<checkboxs.length;i++){
                if(checkboxs[i].checked == true){
                		var temp = checkboxs[i].value;
                		temps = temp.split(",");
                		opener.document.getElementById("strTaskMan").value=temps[0];
                		opener.document.getElementById("strTaskPhone").value=temps[1];
                		window.close();
                	}
                	
          } 
          window.close();
          }
                 
    }
</script>
</head>

<body>
<form name="frm" method="post" action="task_addchooseman.jsp">


<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr>
      <th ><div class="titlebt">
        <div align="left">测试人选择</div>
      </div></th>
  </tr>
  <tr>
    <td height="0" >
        <table border="0" cellpadding="0" cellspacing="0" style="width:100%">
        	<tr><td height="0" align="left"></td></tr>
        	<tr>
        		<td width="100%" height="222">
                <fieldset>
                <legend>测试人列表</legend>
                <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  					 <tr>
					    <td height="45" valign="middle" bgcolor="e1eef7">
					      <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
					        <tr>
					          <td width="35%">测试人员姓名：
					          <input type="text" name="strMainName" value="<%=strMainName %>"/>
					          </td>
					          <td width="40%">测试人员手机号：
					          <input type="text" name="strMainMobile" value="<%=strMainMobile %>"/>
					          <img src="../images/search.jpg" width="58"  align="middle" onclick="showAc()" style="cursor:hand"/></td>
					        </tr>
					      </table></td>
					  </tr>
					</table>
                <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
					    <td width="6%" class="listtit"  style="border-left:1px solid #32a4ea;"> 选择</td>
					    <td width="7%" class="listtit">姓名</td>
					    <td width="5%" class="listtit">性别</td>
					    <td width="10%" class="listtit">归属地</td>
					    <td width="10%" class="listtit">手机号</td>
					    <td width="15%" class="listtit">身份证</td>
					    
					  </tr>
					    <%
					            
					              for (int i = 0;i < vctObj.size(); i++) {
					              String id="";
					              String name = "";
					              String sex = "";
					              String addr ="";
					              String mobile ="";
					              String idnum ="";
					              
					              Maintainer obj1 = vctObj.get(i);
					                if(obj1.getStrMainId()!=null)id=obj1.getStrMainId();
					                if(obj1.getStrMainName()!=null)name=obj1.getStrMainName();
					            	if(obj1.getStrMainSex()!=null)sex=obj1.getStrMainSex();
					            	if(obj1.getStrMainAddr()!=null)addr=obj1.getStrMainAddr();
					            	if(obj1.getStrMainMobile()!=null)mobile=obj1.getStrMainMobile();
					            	if(obj1.getStrMainIdnum()!=null)idnum=obj1.getStrMainIdnum();
					            %>
					
					  <tr>
					    <td class="listd1" style="border-left:1px solid #dddddd;">
					    <input type="checkbox"  name=strManId  id=strManId value="<%=name+","+mobile %>" style="height:12px;"/></td>
					    <td class="listd1" style="border-left:1px solid #dddddd;"><%=name%>&nbsp;</td>
					    <td class="listd1"><%=sex %>&nbsp;</td>
					    <td class="listd1"><%=addr %>&nbsp;</td>
					    <td class="listd1"><%=mobile %>&nbsp;</td>
					    <td class="listd1"><%=idnum %>&nbsp;</td>
					 </tr>
					             <%
					            }
					            %>
					</table>
					<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
						  <tr>
						    <td width="61%" height="50" valign="bottom"><!--<img src="../images/pldel.jpg" width="83" height="27" align="middle" />--> &nbsp;&nbsp;页面记录数
						      <select name="strPageSize" id="strPageSize" style="width:52px;" onchange="showAc()">
								<% 
								 String sltOpt[] = {"10","20","30","50","70","100","所有"};
								 for(int i=0; i < sltOpt.length;i++){
								 	String selected = "";
								    if(sltOpt[i].equals(strPageSize))
								      selected="selected='selected'";
								 %>
								 <option value="<%=sltOpt[i] %>" <%=selected %>><%=sltOpt[i] %></option>
						   		<%
						   		 }
						   		 %>
						   		 </select></td>
						       
						      <td width="39%" align="right" valign="bottom"><!--<table width="310" border="0" cellspacing="0" cellpadding="0">
						       <tr>
						        <td width="40"><img src="../images/up.jpg" width="40" height="30" /></td>
						        <td width="221" align="center" background="../images/page_bg.jpg" class="page"><a href="#">1</a>&nbsp; <a href="#">2</a>&nbsp; <a href="#">3</a>&nbsp; <a href="#"><span class="sel">4</span></a>&nbsp; <a href="#">5</a> &nbsp;<a href="#">6</a> &nbsp;<a href="#">7</a>&nbsp; <a href="#">8 </a>&nbsp;<a href="#">9</a>&nbsp;...&nbsp;<a href="#">13</a> </td>
						        <td width="39"><img src="../images/down.jpg" width="39" height="30" /></td>
						       </tr>
						    </table>
						  -->
						  <!-- 翻页开始 -->  
						     	<%@ include file="../include/jsp/cpage.jsp"%>
						       	<!-- 翻页结束 --> </td>
						  </tr>
						
					</table>
              </fieldset>
              </td>
           </tr>
       </table>
     </td>
  </tr>
  <tr>
      <td colspan="2" align="center" height="28">
            <input type="button" name="b_submit" value="保存"  onclick="check();" style="cursor:hand" class="ipt1"/>
            <input type="button" name="b_reset"    value="重 置"  onclick="frm.reset();" style="cursor:hand" class="ipt2"/>
            <input type="button" name="b_back"     value="关 闭"   onclick="window.close();"style="cursor:hand" class="ipt2"/>
       </td>
  </tr>
 </table>
 
 </div>
</form>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>